  {% include "header.html" %}
  <script type="text/javascript" >
    var agency_id = "{{ agency_id }}";
    var route_type = "{{ route_type }}";
  </script>
  <h1>Trip  List <a href="http://code.google.com/transit/spec/transit_feed_specification.html#routes_txt___Field_Definitions">Refer</a></h1>
  {% if prompt %}
  <p id="prompt">{{ prompt }}</p>
  {% endif %}
  <div id="editor">
    <form method="POST" action="{{ url }}" id="editorform">
      <table>
        <tr>
          <th>Items</th>
          <th>Values</th>
        </tr>
        <tr>
          <td>Route ID</td>
          <td>
          <select name = "route_id" id = "route_id">
          {% for route in routes %}
             {% if route.id == trip.route_id %}
             <option value="{{route.id}}" selected>{{route.longName}}({{route.id}})</option>
             {% else %}
             <option value="{{route.id}}">{{route.longName}}({{route.id}})</option>
             {% endif %}
          {% endfor %}
          </select>
          </td>
        </tr>
        <tr>
          <td>Service ID</td>
          <td>
          <select name = "service_id" id = "service_id">
          {% for service in services %}
             {% if service.id == trip.service_id %}
             <option value="{{service.id}}" selected>{{service.id}}</option>
             {% else %}
             <option value="{{service.id}}">{{service.id}}</option>
             {% endif %}
          {% endfor %}
          </select>
          </td>
        </tr>
        <tr>
          <td>Trip ID</td>
          <td><input name = "trip_id" id = "trip_id" type="TEXT" value="{{ trip.trip_id }}"/></td>
        </tr>
        <tr>
          <td>Headsign</td>
          <td><input name = "trip_headsign" id = "trip_headsign" type="TEXT" value="{{ trip.trip_headsign }}"/></td>
        </tr>
        <tr>
          <td>Short Name</td>
          <td><input name = "trip_short_name" id = "trip_short_name" type="TEXT" value="{{ trip.trip_short_name }}"/></td>
        </tr>
        <tr>
          <td>Block ID</td>
          <td><input name = "block_id" id = "block_id" type="TEXT" value="{{ trip.block_id }}"/></td>
        </tr>
        <tr>
          <td>Direction ID</td>
          <td>
          <select name = "direction_id" id = "direction_id">
             
             {% if trip.direction_id == 1 %}
             <option value="0" >0</option><option value="1" selected>1</option>
             {% else %}
             <option value="0" selected>0</option><option value="1">1</option>
             {% endif %}
          </select>
          </td>
        </tr>
        <tr>
          <td>Shape ID</td>
          <td>
          <select name = "shape_id" id = "shape_id">
          {% for shape in shapes %}
             {% if shape.id == trip.shape_id %}
             <option value="{{shape.id}}" selected>{{shape.id}}</option>
             {% else %}
             <option value="{{shape.id}}">{{shape.id}}</option>
             {% endif %}
          {% endfor %}
          </select>
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <input type="submit" id = "submit" value="{{ submit }}" name = "submit" />
          </td>
        </tr>
        </table>
  </form>


    </div>
<div class="sort">
  <form method="POST" action="" name="search">
    <input type="text" value=""/> <input type="submit" value="Search"/>
  </form>


    </div>
    <div class="pager">
      paging info: [<a href="#">1</a>] [<a href="#">2</a>] ... [<a href="#">last</a>] <input type="text" value="" size="4" maxlength="4"/> <input type="submit" value="Go" />
    </div>
    <table>
      <tr>
        <th>&nbsp;</th>
        <th>Route ID</th>
        <th>Service ID</th>
        <th>Trip ID</th>
        <th>Headsign</th>
        <th>Short Name</th>
        <th>Direction ID</th>
        <th>Block ID</th>
        <th>Shape ID</th>
        <th>Action</th>
      </tr>
      <!--
      <tr>
        <td><input type="checkbox" /></td>
        <td>SLOT</td>
        <td>Boston Data Center </td>
        <td>Australia/Darwin</td>
        <td>en</td>
        <td>(132) 2923-282-ABC</td>
        <td>http://www.google.com</td>
        <td><a href="#">Routes</a></td>
        <td><a href="#">Edit</a>&nbsp;<a href="#">Delete</a><a href="#"></a></td>
      </tr>
      -->
      {% for trip in trips %}
      <tr>
        <td><input type="checkbox" name="deleteid" value="{{trip.id}}"/></td>
        <td>{{trip.route_id}}</td>
        <td>{{trip.service_id}}</td>
        <td>{{trip.trip_id}}</td>
        <td>{{trip.trip_headsign}}</td>
        <td>{{trip.trip_short_name}}</td>
        <td>{{trip.direction_id}}</td>
        <td>{{trip.block_id}}</td>
        <td>{{trip.shape_id}}</td>
        <!--
        <td><a href="#">Patterns</a> <a href="#">Trips</a><a href="/admin/trip?agency={{agency_id}}"></a></td>
        -->
        <td>
          <a href="/admin/trip?act=edit&id={{trip.trip_id}}">Edit</a>&nbsp;
          <a href="/admin/trip?act=delete&id={{trip.trip_id}}">Delete</a>
        </td>
      </tr>
      {% endfor %}
    </table>
    <div class="pager">
      [<a href="#">1</a>] [<a href="#">2</a>] ... [<a href="#">last</a>] <input type="text" value="" size="4" maxlength="4"/> <input type="submit" value="Go" />
    </div>
    <div class="control">
      <input type="submit" value="Delete All"/>
    </div>
  </body>
</html>
